// @ts-ignore
/* eslint-disable */


import {apiRequest, cloudOrderRequest, goodsRequest, orderRequest, userRequest} from "@/utils/HttpRequest";


export async function findByPageList(params?: any) {
  //SwaggerResources


  return goodsRequest<API.LoginLog> (
    "findByPageList", {
      method: "GET", params: {...params}
    } )


}

export async function findByCloudPageList(params?: any) {
  //SwaggerResources


  return goodsRequest<API.LoginLog> (
    "findByCloudPageList", {
      method: "GET", params: {...params}
    } )


}


export async function findByCloudOrderList(params?: any) {
  //SwaggerResources


  return cloudOrderRequest<API.BaseArrayDataResult<API.GoodsTaoCan>> (
    "findGoodsList", {
      method: "GET", params: {...params}
    } )


}

export async function findByFindOrderList(params?: any) {
  //SwaggerResources


  return orderRequest<API.BaseArrayDataResult<API.GoodsTaoCan>> (
    "findGoodsList", {
      method: "GET", params: {...params}
    } )


}


export async function editGoods(params: API.Goods) {
  return goodsRequest<API.BaseResult> ( "edit", {
    method: "POST",
    data: params
  } )
}
export  async  function findByBackId(id:number) {
  return goodsRequest<API.BaseDataResult<API.Goods>> ( "findByBackId", {
    method: "GET",
    params: {id:id}
  } )
}
export  async  function findByBackShowId(id:number) {
  return goodsRequest<API.BaseDataResult<API.Goods>> ( "findByBackShowId", {
    method: "GET",
    params: {id:id}
  } )
}
//

export async function findByGoodsBySelectList() {

  return new Promise<API.GlobalStatus[]> ( (resolve, reject) => {
    goodsRequest<API.BaseArrayDataResult<API.GlobalStatus>> (
      "findByBackSelectList", {
        method: "GET"
      } ).then ( (res) => {
      //   console.log("category/findBySelectList",res)
      resolve ( res?.data )
    } ).catch ( (e => {
      reject ( e )
    }) )
  } )
}
export async function findByPageCategoryList(params?: any) {
  //SwaggerResources


  return apiRequest<API.LoginLog> (
    "category/findByPageList", {
      method: "GET", params: {...params}
    } )


}

export async function editCategory(params: API.Category) {
  return apiRequest<API.BaseResult> ( "category/edit", {
    method: "POST",
    data: params
  } )
}


export async function findByfindBySelectList() {

  return new Promise<API.GlobalStatus[]> ( (resolve, reject) => {
    apiRequest<API.BaseArrayDataResult<API.GlobalStatus>> (
      "category/findBySelectList", {
        method: "GET"
      } ).then ( (res) => {
      //   console.log("category/findBySelectList",res)
      resolve ( res?.data )
    } ).catch ( (e => {
      reject ( e )
    }) )
  } )
}

//findByGoodsAngent
export async function findByGoodsAngent(id: number) {

  return goodsRequest<API.BaseArrayDataResult<API.goodsAgentPrice>> (
      "findByGoodsAngent?id=" + id, {
        method: "GET"
      } )


}

//cloudChange
export async function cloudGoodsChange(params: { type: number,  goodsId: number }) {
  return goodsRequest<API.BaseResult> ( "cloudChange", {
    method: "POST",
    data: params
  } )
}
//findByPageIntegralList
export async function findByPageIntegralList(params?: any) {
  //SwaggerResources


  return goodsRequest<API.LoginLog> (
    "findByPageIntegralList", {
      method: "GET", params: {...params}
    } )


}



